﻿<%@ Page Title="Osobní stránka" Language="C#" MasterPageFile="~/Pages/Site.Master" AutoEventWireup="true" CodeBehind="HomePage.aspx.cs" Inherits="Altairis.FluffyCloud.WebCore.Pages.My.HomePage" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
    <h1>Můj FluffyCloud</h1>
    <aside>
        <asp:ListView ID="NewForumList" runat="server" ItemType="Altairis.FluffyCloud.Data.Topic" SelectMethod="NewForumList_GetData">
            <LayoutTemplate>
                <article>
                    <h2>Nejnovější fóra</h2>
                    <ul>
                        <asp:PlaceHolder ID="ItemPlaceHolder" runat="server" />
                    </ul>
                    <div class="small r">
                        <asp:HyperLink NavigateUrl="<%$ RouteUrl: RouteName=ForumList %>" runat="server" Text="všechna fóra..." />
                    </div>
                </article>
            </LayoutTemplate>
            <ItemTemplate>
                <li>
                    <a href="<%# this.GetRouteUrl("ForumDetail", new { id = Item.TopicId } ) %>" class="strong"><%#: Item.Name %></a>
                    <div class="small"><%#: Item.Description %></div>
                </li>
            </ItemTemplate>
        </asp:ListView>
        <asp:ListView ID="NewUserList" runat="server" ItemType="Altairis.FluffyCloud.Data.User" SelectMethod="NewUserList_GetData">
            <LayoutTemplate>
                <article class="userlist">
                    <h2>Noví uživatelé</h2>
                    <asp:PlaceHolder ID="ItemPlaceHolder" runat="server" />
                    <div class="small r">
                        <asp:HyperLink NavigateUrl="<%$ RouteUrl: RouteName=Users %>" runat="server" Text="všichni uživatelé..." />
                    </div>
                </article>
            </LayoutTemplate>
            <ItemTemplate>
                <div>
                    <my:UserIcon runat="server" UserName="<%# Item.UserName %>" Size="40" NavigateUrl='<%# this.GetRouteUrl("MyUserMessages", new { userName = Item.UserName }) %>' />
                    <div class="username"><a href="<%# this.GetRouteUrl("UserProfile", new { username = Item.UserName } ) %>"><%#: Item.UserName.ToUpper() %></a></div>
                    <div class="species"><%#: Item.Species %></div>
                    <div class="comment"><%#: Item.Comment %></div>
                </div>
            </ItemTemplate>
        </asp:ListView>
    </aside>
    <div class="tabs hasaside" style="overflow: hidden">
        <ul>
            <li><a href="#bookmarks">Oblíbená fóra</a></li>
            <li><a href="#owned">Moje fóra</a></li>
        </ul>
        <div id="bookmarks">
            <asp:ListView ID="MyBookmarks" runat="server" ItemType="Altairis.FluffyCloud.Data.Views.TopicInfo" DataKeyNames="TopicId" SelectMethod="MyBookmarks_GetData">
                <EmptyDataTemplate>
                    <p><b>Nemáte žádná oblíbená fóra.</b></p>
                    <p>Fórum přidáte do oblíbených tak, že jej navštívíte a v horní části stránky klepnete na ikonku <em>Přidat do oblíbených</em>.</p>
                </EmptyDataTemplate>
                <LayoutTemplate>
                    <section class="topics">
                        <asp:PlaceHolder ID="ItemPlaceHolder" runat="server" />
                    </section>
                </LayoutTemplate>
                <ItemTemplate>
                    <article>
                        <header>
                            <asp:HyperLink Text="<%#: Item.Name %>" NavigateUrl='<%# this.GetRouteUrl("ForumDetail", new { id = Item.TopicId }) %>' runat="server" />
                        </header>
                        <aside>
                            <asp:HyperLink NavigateUrl='<%# this.GetRouteUrl("MyHome", null) + "?bookmark-delete=" + Item.TopicId %>' Text="smazat z oblíbených" runat="server" Style="float: right" />
                            <asp:Label Text="aktualizováno" runat="server" CssClass="new" Visible="<%# Item.LastPostDate> Item.LastVisitDate %>" />
                            <span class="owner">
                                <asp:HyperLink NavigateUrl='<%# this.GetRouteUrl("UserProfile", new { username= Item.UserName }) %>' Text="<%#: Item.UserName %>" runat="server" />
                            </span>
                            <span class="postcount"><%# Item.PostCount %></span>
                            <span class="lastpost"><%#: Item.LastPostDate.ToLocalDisplayFormat() %></span>
                            <span class="lastpostby">
                                <asp:HyperLink NavigateUrl='<%# this.GetRouteUrl("UserProfile", new { username= Item.LastPostUserName }) %>' Text="<%#: Item.LastPostUserName %>" runat="server" />
                            </span>
                        </aside>
                        <%#: Item.Description %>
                    </article>
                </ItemTemplate>
            </asp:ListView>
        </div>
        <div id="owned">
            <asp:ListView ID="MyTopics" runat="server" ItemType="Altairis.FluffyCloud.Data.Views.TopicInfo" SelectMethod="MyTopics_GetData">
                <EmptyDataTemplate>
                    <p><b>Nejste vlastníkem žádného fóra.</b></p>
                </EmptyDataTemplate>
                <LayoutTemplate>
                    <section class="topics">
                        <asp:PlaceHolder ID="ItemPlaceHolder" runat="server" />
                    </section>
                </LayoutTemplate>
                <ItemTemplate>
                    <article>
                        <header>
                            <asp:HyperLink Text="<%#: Item.Name %>" NavigateUrl='<%# this.GetRouteUrl("ForumDetail", new { id = Item.TopicId }) %>' runat="server" />
                        </header>
                        <aside>
                            <asp:Label Text="aktualizováno" runat="server" CssClass="new" Visible="<%# Item.LastPostDate> Item.LastVisitDate %>" />
                            <span class="postcount"><%# Item.PostCount %></span>
                            <span class="lastpost"><%#: Item.LastPostDate.ToLocalDisplayFormat() %></span>
                            <span class="lastpostby">
                                <asp:HyperLink NavigateUrl='<%# this.GetRouteUrl("UserProfile", new { username= Item.LastPostUserName }) %>' Text="<%#: Item.LastPostUserName %>" runat="server" />
                            </span>
                        </aside>
                        <%#: Item.Description %>
                    </article>
                </ItemTemplate>
            </asp:ListView>
        </div>
    </div>
</asp:Content>